#define _CRT_SECURE_NO_WARNINGS 1

#include "stl_list.h"

//int main()
//{
//	list<int> lt;
//	lt.push_back(1);
//	lt.push_back(2);
//	lt.push_back(3);
//	lt.push_back(4);
//	lt.push_back(5);
//	lt.push_front(0);
//	for (auto e : lt)
//	{
//		cout << e << " ";
//	}
//	cout << endl;
//	return 0;
//}

void test_list1()
{
	fertilizer::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	auto it = lt.begin();
	while (it != lt.end())
	{
		*it += 1;				//int& ref = *it
								//ref+=1
		cout << *it<< " ";
		++it;					
	}
}

//void test_list2()
//{
//	const fertilizer::list<int> lt;
//	lt.push_back(1);
//	lt.push_back(2);
//	lt.push_back(3);
//	lt.push_back(4);
//	auto it = lt.begin();
//	while (it != lt.end())
//	{
//		*it += 1;				
//		cout << *it << " ";
//		++it;
//	}
//}
struct A
{
	A(int a1 = 0, int a2 = 0)
		:_a1(a1)
		, _a2(a2)
	{
	}

	int _a1;
	int _a2;
};

void test_list3()
{
	list<A> lt;
	lt.push_back(A(1, 1));
	lt.push_back(A(2, 2));
	lt.push_back(A(3, 3));
	lt.push_back(A(4, 4));

	list<A>::iterator it = lt.begin();
	while (it != lt.end())
	{
		//cout << (*it)._a1 << " " << (*it)._a2 << endl;
		cout << it->_a1 << " " << it->_a2 << endl;

		++it;
	}
	cout << endl;
}

void test_list4()
{
	fertilizer::list<int> lt1;
	for (size_t i = 0;i < 4;i++)
	{
		lt1.push_back(i);
	}
	auto it1 = lt1.begin();
	while (it1 != lt1.end())
	{
		cout << *it1 << " ";
		++it1;
	}

	fertilizer::list<int> lt2;
	lt2 = lt1;

	
}


int main()
{

	//test_list1();
	//test_list2();
	//test_list3();
	test_list4();

	return 0;
}